#include <stdio.h>

int num_sum(int n)
{
	if(n > 9)
	{
		return n % 10 + num_sum(n / 10);
	}
	else
	{
		return n;
	}
}

int main()
{
	int num = 0;
	
	scanf("%d", &num);
	int sum = num_sum(num);
	printf("%d ", sum);
	return 0;
}


